﻿using System;

namespace DEMO
{
    using System.Collections.Generic;
    using System.Text.Json;
    class Program
    {
        static void Main(string[] args)
        {
            string sql = @"
CREATE TABLE IFNOTEXISTS `Inf_Printery`(//印刷厂信息
	`Id` INT PRIMARY KEY AUTO NOT NULL,
	`Deprecated` bool NOT NULL DEFAULT FALSE COMMENT '是否已弃用',
	`PrinteryNo` char(6) UNIQUE NOT NULL COMMENT '印刷厂编号',
	`PrinteryName` nvarchar(50) UNIQUE NOT NULL COMMENT '印刷厂名称',
	`Pym` nvarchar(50) NOT NULL COMMENT '名称的拼音码',
	`ContactName` nvarchar(10) NULL COMMENT '联系人',
	`ContactTel` nvarchar(20) NULL COMMENT '联系电话',
	`Address` nvarchar(200) NULL COMMENT '地址',
	`Remark` nvarchar(500) NULL COMMENT '备注'
)engine=aaa comment='印刷厂';

CREATE TABLE IFNOTEXISTS `Inf_Factory`(//工厂信息
	`Id` INT PRIMARY KEY AUTO NOT NULL,
	`FactoryName` nvarchar(50) UNIQUE NOT NULL COMMENT '工厂名称',
	`Pym` nvarchar(50) NOT NULL COMMENT '名称的拼音码',
	`Certificate` nvarchar(200) NULL COMMENT '集成商证书', 
	`Address` nvarchar(200) NULL COMMENT '地址',
	`Remark` nvarchar(500) NULL COMMENT '备注'
)
";

            var sqlv = new SharpSoft.Data.SqlValue("ssdw");
            var str = sqlv.ToTSqlText();
            SharpSoft.Data.GSQL.GSQLAnalyzer ana = new SharpSoft.Data.GSQL.GSQLAnalyzer(sql);
            var stats = ana.ReadStatements();
        }

        public static int GetRootUserIndex(int uindex)
        {

            var ui = uindex;
            while (ui > 15)
            {
                if (ui % 2 == 0)
                {//偶数
                    ui = ui / 2;
                }
                else
                {
                    ui = (ui - 1) / 2;
                }
            }
            return ui;
        }
    }

    class MyClass
    {
        public float aaa { get; set; }
        public string bbb { get; set; }
    }
}
